A data processing apparatus including a microcomputer carries out a series of processes by reading out and executing a program stored in a memory. Usually, the programed processes are executed in accordance with the sequence of the program instructions. However, if a request for interrupting the program is generated in the data processing apparatus or an external circuit, the data processing apparatus suspends processing of the current program now in operation, reads out an interrupting program corresponding to the request, and executes it. After finishing the interrupting program, the data processing apparatus continues the program which is suspended.
One algorithm for shifting the control state of the data processing apparatus from a state of executing the current program to that of executing the interrupting program is a so-called vector interruption process. In the vector interruption process, if a request for interrupting is generated, the data processing apparatus transfers an address indicated by a program counter and program state words to a stack region of the memory. Then, the data processing apparatus reads an initial address of the interrupting program corresponding to the interrupting source from a vector table. Then, the operation is jumped to the initial address of the interrupting program. The data processing apparatus starts executing the interrupting program by fetching a new command code thereof. When execution of the interrupting program finishes, the data processing apparatus reads out the contents of the stack region of the memory, and then restarts executing the program interrupted by the vector interruption.
The vector interruption is used for general purpose; however, it has a disadvantage in that it takes a considerable time to transfer a context such as the address of the current program to the stack region of the memory, to read an initial address of the interrupting program, to restore the context after finishing the interrupting program, etc., so that the vector interruption is difficult to apply to a control program which requires a high speed response.
Recently, there has been developed a microcomputer in which an extremely high speed interrupting process is carried out beside the vector interrupting process, that is a single chip microcomputer "78K/III family" or "78K/VI family" of NEC Corporation. Such a high speed interrupting process is called as a macroservice process.
One type of a conventional data processing apparatus in which the macroservice process is carried out includes an execution unit which executes commands of a program, a bus controller, and an interruption controller which controls the interrupting process.
In the macroservice process, the request for interruption is generated by the interruption controller, and the execution unit samples the request in an interval of execution of commands of the current program. If the request is accepted, the interrupting process is executed by the execution unit in the interval between the two commands of the current program, so that it is not required to transfer the context of the present state to a memory stack region, jump to the interrupting program, fetch a command of the interrupting program, and recall the context.
According to the conventional data processing apparatus, however, there is a disadvantage in that it takes still a substantial time to execute the interrupting process, so that the execution unit is occupied with a time ratio by execution of the interrupting process if there are a number of requests for interruption. Therefore, the execution unit has a time restriction to execute the commands of the current program. If the interrupting process is a relatively simple process such as a simple arithmetic operation or accessing a memory or an internal register, the burden of the execution unit is not so heavy. However, if the interrupting process is more complicated, the burden of the execution unit becomes heavy.